FROM golang:alpine AS build
RUN apk add --no-cache git
RUN git clone https://gitee.com/Aceslup/go101.git
ENV GO111MODULE=on GOPROXY=https://goproxy.cn,direct
RUN cd go101/v2 && go mod init v2 && go get github.com/golang/glog && \
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 && \
    go build -ldflags="-s -w" -o /demo_http demo_http.go

FROM alpine
COPY --from=build /demo_http .
EXPOSE 8080
ENTRYPOINT ["./demo_http"]